package com.yqg.education.service.impl;

import com.yqg.education.entity.SendAnnounce;
import com.yqg.education.mapper.ReceiveAnnounceMapper;
import com.yqg.education.mapper.SendAnnounceMapper;
import com.yqg.education.service.ISendAnnounceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * SendAnnounceServiceImpl 服务实现类
 * @author 张芸博
 * @since 2025-04-10
 */
@Service
public class SendAnnounceServiceImpl extends ServiceImpl<SendAnnounceMapper, SendAnnounce> implements ISendAnnounceService {
    @Resource
    private SendAnnounceMapper sendAnnounceMapper;
    @Resource
    private ReceiveAnnounceMapper receiveAnnounceMapper;
    @Override
    public SendAnnounce stuFindSendAnnounceContent(Integer announceId, Integer userId) {
        //修改状态为已读
        receiveAnnounceMapper.stuUpdateStateBYAnnounceIdAndUserId(announceId,userId);
        return sendAnnounceMapper.stuFindSendAnnounceContent(announceId,userId);
    }
}
